<template>
<div id="box">
    <div class="center1" v-for="(list,index) in lists" :key="index" @click="go(index)">
      <router-link :to="'/Detail/' +list.id">
        <div class="center-con1">
            <img :src="list.img" alt="">
        </div>
        <div class="center-con2">
                    <h2>
                        {{list.name}}
                    </h2>
                    <ul class="ul1">{{list.date}}</ul>
                    <ul class="ul2">{{list.address}}</ul>
                    <ul class="ul3">
                        <li>NO.{{list.discount}}</li>
                        <li>可选座</li>
                    </ul>
                    <li class="li1"><span>￥{{list.price}}</span>起</li>
                    <div class="box"><van-rate v-model="list.star" readonly size="6" color="#f98f45" /> <span>{{list.score}}</span></div>
        </div>
        </router-link>
    </div>
</div>
</template>
<script>
import axios from "axios";

export default {
  name: "WonderfulShow",
  created() {
    axios({
      url: "/shopList",
      method: "get"
    }).then(res => {
        this.lists=res.data;
    });
  },
  data(){
    return{
      lists:[],
    }
  },
  methods:{
    go(idx){
    //   console.log(this.lists[idx].number)
      this.$router.push({ path: '/Detail',query: { num: this.lists[idx].number } })
    }
  }
};
</script>

<style scoped>
#box {
  width: 3.27rem;
  margin: 0 auto;
  font-size: 0.15rem;
}
.center1 {
  display: flex;
  justify-content: space-around;
  margin-top: 0.2rem;
}
.center-con1 {
  float: left;
  width: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.035rem;
  background-size: contain;
}
.center-con1 img{
    width: 100%;
    height: 100%;
}
.center-con2 {
  float: right;
  width: 2rem;
  height: 100%;
  position: relative;
  margin-left: 0.15rem;
}
.center-con2 h2 {
  font-size: 0.16rem;
}
.center-con2 ul {
    line-height: 0.23rem;
  font-size: 0.13rem;
  color: #9b9ba3;
}
.center-con2 .ul1 {
  margin-top: 0.05rem;
}
.center-con2 .ul3 {
  margin-top: 0.05rem;
  display: flex;
}
.center-con2 li {
    padding: 0.01rem 0.05rem;
  text-align: center;
  margin-right: 0.05rem;
  border-radius: 0.12rem;
  border: 1px solid #d6a473;
  color: #f09d4d
}
.center-con2 .li1 {
    display: inline-block;
    border: none;
  width:0.5rem;
  font-size: 0.085rem;
  color: #9c9ca4;
  margin-top: 0.05rem;
  margin-left: -0.1rem;
}
.li1 span {
  display: inline-block;
  font-size: 0.1rem;
  color: #ff2969;
  margin-right: 0.05rem;
}
.box {
  display: flex;
  position: absolute;
  right: 0.05rem;
  bottom: 0;
  font-size: 0.08rem;
}
.box span {
  margin-left: 0.08rem;
}
</style>
